<!-- Bot Console -->
<!-- Author: Edwin -->
<template>
  <div class='bot-console'>
    <el-row>
      <el-col :span="24">
        <div class="line-height: 1.15;
    height: 3em;
    border-bottom: 3px solid #333;">{{botInfo.name}}</div>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="4">
        <PageBox linkComponent='Action' />
      </el-col>
      <el-col :span="20">
        <PageBox linkComponent='ConnectorConfig' />
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <PageBox linkComponent='Functions' :boxData="botInfo"/>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <PageBox linkComponent='MessageReport' />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import PageBox from './BotConsoleComponents/page-box'

export default {
  components: { PageBox },
  data () {
    return {
      botInfo: {
        id: '',
        tenantCode: '',
        name: '',
        icon: null,
        description: '',
        enable: true,
        url: null,
        sysVersion: '1.0',
        createTime: null,
        updateTime: null,
        sysBotId: '',
        version: '1.0',
        sysEnable: true
      }
    }
  },
  created () {
    this.botInfo.id = this.$route.query.id
    this.init()
  },
  methods: {
    init () {
      this.$interface.bots.getTenantBotInfoApi({ id: this.botInfo.id })
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.botInfo = res.data
        }).catch(() => { })
    }
  }
}
</script>

<style scoped>
  .c-usage-content {
    border-radius: 4px;
    border-width: 0px;
    left: 90px;
    top: 153px;
    width: 553px;
    height: 129px;

  }
</style>
